package com.yuncheng.spcyApi.service.impl;

import com.yuncheng.spcyApi.constant.common.SpcyCommonConstant;
import com.yuncheng.spcyApi.entity.PartyRsDfjnjl;
import com.yuncheng.spcyApi.mapper.PartyRsDfjnjlMapper;
import com.yuncheng.spcyApi.service.IPartyRsDfjnjlService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.yuncheng.common.base.service.impl.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Description: 党费缴纳记录
 * @Author: yuncheng
 * @Date: 2023-11-29
 * @Version: V1.0
 */
@Service
public class PartyRsDfjnjlServiceImpl extends BaseServiceImpl<PartyRsDfjnjlMapper, PartyRsDfjnjl> implements IPartyRsDfjnjlService {

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void initAddDfjl(PartyRsDfjnjl dfjnjl) {
        if (StringUtils.isBlank(dfjnjl.getFjfzt())){
            dfjnjl.setFjfzt(SpcyCommonConstant.DF_JNJL_JFZT_DJF);
        }
        if (StringUtils.isBlank(dfjnjl.getFjffs())){
            dfjnjl.setFjffs("线上");
        }
        save(dfjnjl);
    }
}
